home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_ambcndlbridge.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  81 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_AmbCndlBridge.cog
  4. #
  5. # Plays random ambient sounds at random positions and drops
  6. # snow at all the positions all the time.
  7. #
  8. # [TRM]
  9. #
  10. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message        entered
  16.     message     pulse
  17.  
  18.     thing        soundPos0        nolink
  19.     thing        soundPos1        nolink
  20.     thing        soundPos2        nolink
  21.     thing        soundPos3        nolink
  22.     
  23.     sector      start_Amb1      linkID=1
  24.     
  25.     sector      stop_Amb1       linkID=0
  26.     
  27.     sound        ambient0=shw_amb1.wav   local
  28.     sound        ambient1=shw_amb2.wav   local
  29.     sound        ambient2=shw_amb3.wav   local
  30.     sound        ambient3=shw_amb4.wav   local
  31.     sound        ambient4=shw_amb5.wav   local
  32.     sound        ambient5=shw_amb6.wav   local
  33.     sound        ambient6=shw_amb7.wav   local
  34.     
  35.     template    tpl_Snow=skitosnow      local
  36.     
  37.     int         playing=0               local
  38.     
  39. end
  40.  
  41. # ========================================================================================
  42.  
  43. code
  44.  
  45. entered:
  46.  
  47.     if((GetSenderID() == 1) && (playing == 0))
  48.     {
  49.         playing = 1;
  50.         setpulse(2.0);
  51.     }
  52.     
  53.     if(GetSenderID() == 0)
  54.     {
  55.         Print("AmbCndlBridge: off");
  56.         playing = 0;
  57.         SetPulse(0.0);
  58.     }
  59.     
  60.     return;
  61.  
  62. # ========================================================================================
  63.  
  64. pulse:
  65.  
  66.     PlaySoundThing(ambient0[RandBetween(0, 6)], soundPos0[RandBetween(0, 3)], 1.0, 15, 30, 0);
  67.     
  68.     if(GetPerformanceLevel() >= 2)
  69.     {
  70.         CreateThing(tpl_Snow, soundPos0);        
  71.         CreateThing(tpl_Snow, soundPos1);        
  72.         CreateThing(tpl_Snow, soundPos2);        
  73.         CreateThing(tpl_Snow, soundPos3);
  74.     }        
  75.     
  76.     return;
  77.  
  78. # ========================================================================================
  79.  
  80. end
  81.